package com.heima.mapper;

import com.heima.pojo.dto.Node;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.pojo.dto.NodeDto;
import com.heima.pojo.po.BusinessType;
import com.heima.pojo.vo.RegionVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 点位表 Mapper 接口
 * </p>
 *
 * @author 存折
 * @since 2024-10-19
 */
public interface NodeMapper extends BaseMapper<Node> {

@Select("select count(*) from tb_vending_machine where node_id =#{id}")
    Integer getcount(Long id);


@Select("select * from tb_business where id=#{businnessId}")
    BusinessType getBusName(Integer businessId);


@Select("select * from tb_region where id=#{regionId}")
    RegionVo getRegName(Long regionId);



    @Select("select inner_code,vm_status,last_supply_time from tb_vending_machine where node_id=#{id}")
    List<NodeDto> selectDetail(Long id);

}
